package org.hertsig.entities;

public enum Rarity {
	Common,
	Uncommon,
	Rare,
	MythicRare,
	Special,
	Land;
	
	public static Rarity getByName(String name) {
		if (name.equals("Mythic Rare")) {
			return MythicRare;
		}
		if (name.contains(" ")) {
			return valueOf(name.substring(0, name.indexOf(' ')));
		}
		switch(name) {
			case "R1":
			case "U1":
				return Rare;
			case "U2":
			case "U3":
			case "U4":
				return Uncommon;
			case "C1":
			case "C2":
			case "C3":
			case "C4":
			case "C5":
				return Common;
			default:
				return valueOf(name);
		}
	}
}
